<template>
	<view class="warp">
		<view class="list">
			<view @click="toinfo(item)" class="item" v-for="(item,index) in praclist" :key="index">
				<view class="i_left">
					<video style="width: 320rpx;height: 200rpx;" :src="item.websiteImage"></video>
					<!-- <image style="width: 320rpx;height: 200rpx;" :src="item.websiteSellerImage" mode="aspectFill"></image> -->
				</view>
				<view class="i_right">
					<view class="i_title">
						{{item.websiteTitle}}
					</view>
					<view class="i_context" v-html="item.websiteContent">
						
					</view>
					<view class="xiang">
					详情
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState, mapMutations } from 'vuex'
	export default {
		// 学习中心
		data() {
			return {
				praclist:[],
				queryform:{
					pageSize:20,
					current:1,
					websiteType:'7',//类型
				},
				total:0,
				type:null,
			};
		},
		computed: {
		  ...mapState(['hasLogin', 'userInfo', 'userCenterData'])
		},
		onLoad(e) {
			if(e){
				this.type=e.type
			}
			this.getlist()
		},
		// 下拉
			onPullDownRefresh() {
				// 刷新位置
			this.getlist()
				var that=this
				setTimeout(function(){
						uni.stopPullDownRefresh()
					},1000)
			},
			onReachBottom(){
				if(this.queryform.pageSize*this.queryform.current>this.total){
					uni.showToast({
						title:"数据加载完毕",
						icon:'none'
					})
				}else{
					this.queryform.current++
					this.$request({
						url:'v3/website/front/member/list',
						method:'GET',
						data:this.queryform
					}).then(res=>{
						this.praclist.push(...res.data.list)
						
					})
				}
			},
		methods:{
			getlist(){
					this.queryform.vendorId=uni.getStorageSync('storeId') 
			if(this.type==1){
								 // 查看自己
								 this.queryform.vendorId=this.userCenterData.vendorId
			}else{
								 // 查看浏览协会
								this.queryform.vendorId=uni.getStorageSync('storeId') 
			}	
				// this.queryform.vendorId=uni.getStorageSync('storeId')
				this.$request({
					url:'v3/website/front/member/list',
					method:'GET',
					data:this.queryform
					 
				}).then(res=>{
					if(res.state==200){
						this.praclist=res.data.list
						this.total=res.data.pagination.total
					}
				})
				
				
				
			},
			// 详情
			toinfo(val){
				uni.navigateTo({
					url:"/webcont/xvideoinfo/xvideoinfo?id="+val.websiteId
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
page{
			width: 750rpx;
			margin: 0 auto;
			background: #F5F5F5;
			
		}
		.warp{
			padding: 10rpx;
			.list{
				.item{
					background-color: #fff;
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 10rpx;
					padding: 20rpx;
					border-radius: 10rpx;
					position: relative;
					.i_left{
						
					}
					.i_right{
						
						width: 370rpx;
						text-align: center;
						.i_title{
							font-size: 32rpx;
							font-weight: 550;
						}
						.i_context{
							padding-left: 20rpx;
							overflow: hidden;
							 text-overflow: ellipsis;
							 display: -webkit-box; 
							 -webkit-box-orient: vertical;
							 -webkit-line-clamp:2;
						}
						.xiang{
							position: absolute;
							bottom: 10rpx;
							right: 10rpx;
							color: #cecece;
						}
					}
				}
			}
		}
</style>
